let fs = require('fs');
let Promise = require('bluebird');

exports.readFileAsync = (fpath, enCoding) => {
  return new Promise((resolve, reject) => {
    fs.readFile(fpath, enCoding, (err, data) => {
      if (err) reject(err)
      else resolve(data)
    })
  })
};
exports.writeFileAsync = (fpath, content) => {
  return new Promise((resolve, reject) => {
    fs.writeFile(fpath, content, (err) => {
      if (err) reject(err)
      else resolve()
    })
  })
}

